package com.game.my.model;

import java.util.List;

import com.eova.common.base.BaseModel;

public class GameInfo extends BaseModel<GameInfo> {

	private static final long serialVersionUID = 1L;
	public static final GameInfo dao = new GameInfo();

	public List<GameInfo> getGameInfo(Object openId) {
		StringBuffer sql = new StringBuffer();
		sql.append("SELECT gif.id,rif.roomName,gdl.userBet,date_format(gdl.createTime,'%m-%d %h:%m')time,gif.lotteryResults");
		sql.append(" FROM game_info gif INNER  JOIN game_detail_info gdl ON gif.id=gdl.gameId");
		sql.append(" INNER JOIN room_info rif ON gif.roomId=rif.id");
		sql.append(" WHERE gdl.userId=? ORDER BY  time desc  ");
		return this.find(sql.toString(), openId);
	}
}
